Skip to content

fix(isISO8601): reject whitespace other than space as date-time separator - #2864

Open
abhijeet117 wants to merge 1 commit into
validatorjs:masterfrom
abhijeet117:fix/isISO8601-whitespace-separator
Open

fix(isISO8601): reject whitespace other than space as date-time separator#2864
abhijeet117 wants to merge 1 commit into
validatorjs:masterfrom
abhijeet117:fix/isISO8601-whitespace-separator

Conversation

@abhijeet117

Copy link
Copy Markdown

Summary

The default isISO8601 pattern separated the date and time parts with [T\s], so tab, newline, form feed, and vertical tab were all accepted as separators. Neither ISO 8601 nor RFC 3339 permits these; RFC 3339 only adds the plain space by convention. This narrows the class to [T ], keeping the space while rejecting the rest. strictSeparator: true behavior is unchanged.

Testing

Reproduced before the fix: isISO8601('2009-05-19\t14:39:22') and the newline, form feed, and vertical tab variants all returned true. Added a focused regression case in test/validators.test.js that fails on the old pattern and passes after the change.

Checklist

  • bug reproduced before fix
  • root cause identified
  • bug fixed
  • tests passed

@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a79ff98) to head (c95ebdf).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2864   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2599      2599           
  Branches       658       658           
=========================================
  Hits          2599      2599           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant